//
//  FCollectionViewCell.m
//  YiQiTingShu
//
//  Created by dllo on 15/11/4.
//  Copyright © 2015年 直到世界的尽头. All rights reserved.
//

#import "FCollectionViewCell.h"
#import "PublicHeader.h"

@implementation FCollectionViewCell

#pragma mark - 懒加载
-(UIImageView *)mainImageView
{
    if (!_mainImageView) {
        _mainImageView = [[UIImageView alloc] init];
        [self addSubview:_mainImageView];
    }
    return _mainImageView;
}

-(UILabel *)titleLabel
{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] init];
        [_titleLabel NightWithType:UIViewColorTypeNormal];
        [self addSubview:_titleLabel];
    }
    return _titleLabel;
}

-(UILabel *)subTitle
{
    if (!_subTitle) {
        _subTitle = [[UILabel alloc] init];
        [_subTitle NightWithType:UIViewColorTypeNormal];
        [self addSubview:_subTitle];
    }
    return _subTitle;
}

-(void)setTypes:(FCollectionViewCellType)types
{
    switch (types) {
        case FCollectionViewCellTypeRecommend:
            self.mainImageView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height - 40 * FitHeight);
            self.titleLabel.frame = CGRectMake(0, _mainImageView.frame.size.height, self.frame.size.width, 40 * FitHeight);
            self.titleLabel.numberOfLines = 2;
            self.titleLabel.font = [UIFont systemFontOfSize:12];
            
            self.subTitle.frame = CGRectMake(0, _mainImageView.frame.size.height - 20, self.frame.size.width, 20 * FitHeight);
            self.subTitle.textType = [NSNumber numberWithInteger:LabelColorGray];
            self.subTitle.font = [UIFont systemFontOfSize:10];
            [self.subTitle NightWithType:UIViewColorType1];
            self.subTitle.alpha = 0.5;
            break;
            
        default:
            break;
    }
}
@end
